﻿<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:VMDS_GUIClient_ViewModels="clr-namespace:VMDS.GUIClient.ViewModels" xmlns:Custom="http://schemas.microsoft.com/winfx/2006/xaml/presentation/ribbon"
	x:Class="VMDS.GUIClient.Views.MainWindow"
	x:Name="Window"
	Title="СУВМ" Style="{DynamicResource WindowStyle1}" d:DesignHeight="607" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" mc:Ignorable="d" Background="{x:Null}" Width="800" Height="600" MouseLeftButtonDown="Window_MouseLeftButtonDown" ResizeMode="CanMinimize" AllowsTransparency="False" Icon="Images/window_demo.png">
	<Window.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="ResourceDictionary1.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
			<!-- Button Styles -->
			<Style x:Key="Button" TargetType="{x:Type Button}">
				<Setter Property="Background">
					<Setter.Value>
						<RadialGradientBrush>
							<GradientStop Offset="0" Color="Black" />
							<GradientStop Offset="1" Color="Black" />
						</RadialGradientBrush>
					</Setter.Value>
				</Setter>
				<Setter Property="Height" Value="40" />
				<Setter Property="Foreground" Value="white" />
				<Setter Property="Grid.Row" Value="2" />
				<Setter Property="Grid.Column" Value="3" />
				<Setter Property="Margin" Value="3" />
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="{x:Type Button}">
							<ControlTemplate.Resources>
								<Storyboard x:Key="Timeline1">
									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
										<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0.8"/>
										<SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="1"/>
									</DoubleAnimationUsingKeyFrames>
								</Storyboard>
							</ControlTemplate.Resources>
							<Grid x:Name="grid" RenderTransformOrigin="0.5,0.5">
								<Grid.RowDefinitions>
									<RowDefinition Height="0.525*"/>
									<RowDefinition Height="0.475*"/>
								</Grid.RowDefinitions>
								<Grid.RenderTransform>
									<TransformGroup>
										<ScaleTransform ScaleX="1" ScaleY="1"/>
										<SkewTransform AngleX="0" AngleY="0"/>
										<RotateTransform Angle="0"/>
										<TranslateTransform X="0" Y="0"/>
									</TransformGroup>
								</Grid.RenderTransform>
								<Rectangle x:Name="GelBackground" Opacity="1" RadiusX="9" RadiusY="9" Fill="{TemplateBinding Background}" StrokeThickness="0.35" Grid.RowSpan="2">
									<Rectangle.Stroke>
										<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
											<GradientStop Offset="0" Color="White" />
											<GradientStop Offset="1" Color="#666666" />
										</LinearGradientBrush>
									</Rectangle.Stroke>
								</Rectangle>
								<Rectangle x:Name="GelShine" Margin="2" VerticalAlignment="Stretch" RadiusX="6" RadiusY="6" Opacity="1" Stroke="Transparent" Height="Auto">
									<Rectangle.Fill>
										<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
											<GradientStop Offset="0" Color="#ccffffff" />
											<GradientStop Offset="1" Color="Transparent" />
										</LinearGradientBrush>
									</Rectangle.Fill>
								</Rectangle>

								<ContentPresenter x:Name="GelButtonContent" VerticalAlignment="Center" HorizontalAlignment="Center" Content="{TemplateBinding Content}" Grid.RowSpan="2" />
							</Grid>

							<ControlTemplate.Triggers>

								<Trigger Property="IsMouseOver" Value="true">
									<Trigger.EnterActions>
										<BeginStoryboard Storyboard="{StaticResource Timeline1}"/>
									</Trigger.EnterActions>
									<Setter TargetName="GelBackground" Property="Fill">
										<Setter.Value>
											<RadialGradientBrush>
												<GradientStop Offset="0.005" Color="#FF00DDFF" />
												<GradientStop Offset="1" Color="#FF1B0064" />
											</RadialGradientBrush>
										</Setter.Value>
									</Setter>
								</Trigger>
								<Trigger Property="IsPressed" Value="true">
									<Setter Property="Fill" TargetName="GelBackground">
										<Setter.Value>
											<RadialGradientBrush>
												<GradientStop Offset="0" Color="#ffcc00" />
												<GradientStop Offset="1" Color="#cc9900" />
											</RadialGradientBrush>
										</Setter.Value>
									</Setter>
								</Trigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
				<Style.Triggers>
					<Trigger Property="IsMouseOver" Value="true">
						<Setter Property="Foreground" Value="black " />
					</Trigger>
					<Trigger Property="IsPressed" Value="true">
						<Setter Property="Foreground" Value="black " />
					</Trigger>
				</Style.Triggers>
			</Style>
			<!-- PlayButton -->
    
			<Style x:Key="RoundButton" BasedOn="{StaticResource Button}" TargetType="{x:Type Button}">
				<Setter Property="Width" Value="100" />
				<Setter Property="Height" Value="100" />
				<Setter Property="Grid.Row" Value="2" />
				<Setter Property="Content" Value="Logon" />
				<Setter Property="LayoutTransform">
					<Setter.Value>
						<TranslateTransform X="70" Y="-10" />
					</Setter.Value>
				</Setter>
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="{x:Type Button}">
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="0.077*"/>
									<RowDefinition Height="0.41*"/>
									<RowDefinition Height="0.13*"/>
									<RowDefinition Height="0.382*"/>
								</Grid.RowDefinitions>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="0.122*"/>
									<ColumnDefinition Width="0.754*"/>
									<ColumnDefinition Width="0.124*"/>
								</Grid.ColumnDefinitions>
								<Ellipse x:Name="GelBackground" StrokeThickness="0.5" Grid.ColumnSpan="3" Grid.RowSpan="4">
									<Ellipse.Stroke>
										<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
											<GradientStop Offset="0" Color="#FF7E7E7E" />
											<GradientStop Offset="1" Color="Black" />
										</LinearGradientBrush>
									</Ellipse.Stroke>
									<Ellipse.Fill>
										<RadialGradientBrush>
											<GradientStop Offset="0" Color="Black" />
											<GradientStop Offset="1" Color="Black" />
										</RadialGradientBrush>
									</Ellipse.Fill>
								</Ellipse>
								<Ellipse  Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" Width="Auto" Height="Auto" Margin="0" VerticalAlignment="Stretch">
									<Ellipse.Fill>
										<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
											<GradientStop Offset="0" Color="#aaffffff" />
											<GradientStop Offset="1" Color="Transparent" />
										</LinearGradientBrush>
									</Ellipse.Fill>
								</Ellipse>
								<ContentPresenter x:Name="GelButtonContent" VerticalAlignment="Center" HorizontalAlignment="Center" Content="{TemplateBinding Content}" Height="Auto" Grid.Column="1" Grid.Row="0" Margin="0" d:LayoutOverrides="Height" Panel.ZIndex="1" Grid.RowSpan="4"  />
							</Grid>
							<ControlTemplate.Triggers>

								<Trigger Property="IsMouseOver" Value="true">
									<Setter Property="Fill" TargetName="GelBackground">
										<Setter.Value>
											<RadialGradientBrush>
												<GradientStop Offset="0" Color="#FF00C7FF" />
												<GradientStop Offset="1" Color="#FF000464" />
											</RadialGradientBrush>
										</Setter.Value>
									</Setter>
								</Trigger>
								<Trigger Property="IsPressed" Value="true">
									<Setter Property="Fill" TargetName="GelBackground">
										<Setter.Value>
											<RadialGradientBrush>
												<GradientStop Offset="0" Color="#ffcc00" />
												<GradientStop Offset="1" Color="#cc9900" />
											</RadialGradientBrush>
										</Setter.Value>
									</Setter>
								</Trigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
				<Style.Triggers>
					<Trigger Property="IsMouseOver" Value="true">
						<Setter Property="Foreground" Value="black " />
					</Trigger>
					<Trigger Property="IsPressed" Value="true">
						<Setter Property="Foreground" Value="black " />
					</Trigger>
				</Style.Triggers>
			</Style>
		</ResourceDictionary>
	</Window.Resources>
    
    <Window.DataContext>
    	<VMDS_GUIClient_ViewModels:MainWindowViewModel/>
	</Window.DataContext>
	<Grid x:Name="LayoutRoot" Margin="0">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		<Rectangle Margin="0,-18,16,-4" Stroke="#FF121111" StrokeThickness="0.5" RadiusX="10" RadiusY="10" HorizontalAlignment="Right" Width="{Binding ActualWidth, ElementName=stackPanel}">
			<Rectangle.Fill>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.435">
					<LinearGradientBrush.RelativeTransform>
						<TransformGroup>
							<ScaleTransform CenterY="0.5" CenterX="0.5"/>
							<SkewTransform CenterY="0.5" CenterX="0.5"/>
							<RotateTransform CenterY="0.5" CenterX="0.5" Angle="90"/>
							<TranslateTransform/>
						</TransformGroup>
					</LinearGradientBrush.RelativeTransform>
					<GradientStop Color="#FF121111"/>
					<GradientStop Offset="0.558"/>
					<GradientStop Color="#FF121111" Offset="1"/>
					<GradientStop Offset="0.494"/>
				</LinearGradientBrush>
			</Rectangle.Fill>
		</Rectangle>
		<StackPanel x:Name="stackPanel" Orientation="Horizontal" HorizontalAlignment="Right">
		<Button x:Name="button_Copy1" 
			Margin="0,-14,10,0" Style="{DynamicResource BlueButton}" Height="32" Command="{Binding VmSelect, Mode=OneWay}" IsDefault="{Binding VmSelected}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="44.5" FontSize="16" ToolTip="Библиотека виртуальных машин" >
			<Image Source="Images/reload.png" Margin="0,2"/>
		</Button>
		<Button x:Name="button" 
			Margin="0,-14,10,0" Style="{DynamicResource DisabledButton}" Height="32" Command="{Binding AdmSelect, Mode=OneWay}" IsDefault="{Binding AdmSelected}" Grid.Column="0" HorizontalAlignment="Right" Grid.Row="1" VerticalAlignment="Top" FontSize="16" ToolTip="Раздел для администраторов" IsEnabled="{Binding AdmAvailable, Mode=OneWay}" >
			<TextBlock Text="{Binding AdmButtonText}" Margin="5,0"/>
			</Button>
		<Button Grid.Column="0" HorizontalAlignment="Right" Margin="0,-14,18,0" Grid.Row="1" Style="{DynamicResource RoundButton}" Width="32" Height="32" Content="X" Command="{Binding Close, Mode=OneWay}" VerticalAlignment="Top" d:LayoutOverrides="GridBox" ToolTip="ВЫход из программы"/>
		</StackPanel>
		<Frame Margin="8,12,8,10" Grid.Row="1" x:Name="frmContent" NavigationUIVisibility="Hidden" BorderThickness="2" Source="{Binding NavigationLink, Mode=OneWay}" Content="" />
		<StackPanel Margin="8,8,8,0" Grid.Row="1" VerticalAlignment="Top" Orientation="Horizontal" HorizontalAlignment="Center"/> 
	</Grid>
</Window>